/***************************************************************************
 *   Copyleft 2008-2009 by												   *
 *	 Iwanicki Krzysztof													   *
 *   <gamma.mini.pw.edu.pl/~iwanickik>									   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 ***************************************************************************/
#ifndef __VGLSTATE_H__
#define __VGLSTATE_H__

#include "./vState.h"
#include "../../Macros/vMemoryMacros.h"

namespace Vendetta {
	/**
	 *	OpenGL based shading state class.
	 *	@see vState
	 */
	class vGlState: public vState {

	public:
		vGlState();
		~vGlState();

		/*
		 *	All necessary stuff to abstract shading state management from any API.
		 */
		//vVoid SetTexture(const cTextureHandler &textureHandler, const vInt textureUnit);
		//vVoid SetTexture(const cTextureHandler &textureHandler);
		//vVoid SetBlankTexture(const vInt textureUnit);
		vVoid EnableTexture(const vInt textureUnit);
		vVoid EnableTexture();
		vVoid DisableTexture(const vInt textureUnit);
		vVoid DisableTexture();
		vVoid ResetTexture(const vInt textureUnit);

		vVoid EnableTransparency();
		vVoid DisableTransparency();

		vVoid SetBlend(const vInt blend);
		vVoid SetBlendFunc(const vInt blendSrc, const vInt blendDst);
		vVoid SetAlphaTest(const vInt alphaTest);
		vVoid SetAlphaFunc(const vInt alphaFunc, const vReal alphaValue);
		vVoid SetColor(const vReal red, const vReal green, const vReal blue, const vReal alpha);
		vVoid SetColor(const vColor &color, const vReal alphaMultiplier);
		vVoid SetColor(const vColor &color);
		vVoid SetClearColor(const vColor &color);
		vVoid SetClearDepth(const vReal val);
		vVoid SetColorMask(const vInt redMask, const vInt greenMask, const vInt blueMask, const vInt alphaMask);
		vVoid SetDepthTest(const vInt depthTest);
		vVoid SetDepthFunc(const vInt depthFunc);
		vVoid SetDepthMask(const vInt depthMask);
		vVoid SetStencilTest(const vInt stencilTest);
		vVoid SetStencilFunc(const vInt stencilFunc, const vInt stencilRef, const vInt stencilMask);
		vVoid SetStencilOps(const vInt stencilFail, const vInt stencilZFail, const vInt stencilZPass);
		vVoid SetCulling(const vInt culling);
		vVoid SetCullingFunc(const vInt cullingFunc);
		vVoid SetCullingMode(const vInt cullingMode);
		vVoid SetFill(const vInt fill);
		vVoid SetShading(const vInt shading);
		vVoid SetLighting(const vInt lighting);
		vVoid SetSpecular(const vInt specular);

	protected:

		/**
		 *	Inits terms describing shading state.
		 *	Depending on choosen rendering API they can be
		 *	changed so they fit certain API specific values
		 *	e.g. ONE to GL_ONE
		 */
		vVoid initTerms();

	};
}

#endif //__VGLSTATE_H__